package com.tanhua.autoconfig;


import com.tanhua.autoconfig.properties.*;
import com.tanhua.autoconfig.templates.*;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

@EnableConfigurationProperties(
        value = {
                SmsProperties.class//放入到容器中，相当于在SmsPorperties中加入了@Componet注解
                , OssProperties.class,
                AipFaceProperties.class,
                HuanXinProperties.class,
                GreenProperties.class
        }
)
public class TanhuaAutoConfiguration {

    @Bean
    public SmsTemplate smsTemplate() {
        return new SmsTemplate();
    }

    @Bean
    public OssTemplate ossTemplate() {
        return new OssTemplate();
    }

    @Bean
    public AipFaceTemplate aipFaceTemplate() {

        return new AipFaceTemplate();
    }

    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties properties) {

        return new HuanXinTemplate(properties);
    }
    @Bean
    public AliyunGreenTemplate aliyunGreenTemplate(GreenProperties properties) {
        return new AliyunGreenTemplate(properties);
    }
}
